/*   Copyright (C) 2006  Mike Chirico <mchirico@users.sourceforge.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.
 
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
     You should have received a copy of the GNU General Public License along
     with this program; if not, write to the Free Software Foundation, Inc.,
     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.  */


#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>

#include <string.h>		/* for strerror(int errno) */
#include <errno.h>

#include <string>
#include <iostream>


class Banssh {


};




std::string file;
std::string email;


std::string getconfig()
{

extern int num_lines;
extern int num_chars;
extern int state_chg[];
extern int i;
extern int fp0,fp1,fp2,fp3,fp4,fp5;
extern void yylex();

	extern FILE *yyin, *yyout;
	extern char buf_file[];
	extern char buf_email[];

	yyin = fopen((const char *) "banssh.conf", "r");
	if (yyin == NULL) {	/* open failed */
	  fprintf(stderr,"Cannot open config file\n");
			return "";
	}
	yylex();

	file=buf_file;
	buf_file[0]='\0';

	email=buf_email;
	buf_email[0]='\0';
	
	return file;
}

std::string getemail()
{
  return email;
}


std::string getattempts()
{

extern int num_lines;
extern int num_chars;
extern int state_chg[];
extern int i;
extern int fp0,fp1,fp2,fp3,fp4,fp5;
extern void yylex();

	extern FILE *yyin, *yyout;
	extern char buf[];

	yyin = fopen((const char *) file.c_str(), "r");
	if (yyin == NULL) {	/* open failed */
	  fprintf(stderr,"Cannot open config file\n");
			return "";
	}
	yylex();

	return buf;
}




